home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 128 35
/
q35.d81
/
t.ps to font
< prev
next >
Wrap
Text File
|
2022-08-28
|
16KB
|
376 lines
1 2 8 P R I N T S H O P T O F O N T
Program and Text by Bob Markland
The primary reason for selecting a C-128 over a C-64, aside from the
extra memory, is the 80-column mode. And here at LOADSTAR 128 nearly every
program is in the 80-column mode.
As you no doubt know, the C-128 uses the text-oriented 8563 Video
Display Controller chip (VDC) to display the 80-column screen. Besides
allowing longer screen lines, its advantages include vivid colors,
additional attributes, and the ability to display two fonts (512 different
characters) simultaneously. And, unlike the VIC chip which stores
characters in ROM, the VDC chip's character sets are addressable in place.
But, alas, there is a down side -- the VDC chip is text-oriented. There
is a limited bit-map mode, but the 640 x 400 pixels eat up nearly all of
the 8563's available memory. Ordinarily only the background and one
foreground color is available -- you can cut the bit-map by 1/4 and regain
color control -- but in any event the character sets are gone.
An experienced (or masochistic) M/L programmer can overcome these
problems, but few have even attempted it. And no adequate solution is
available from BASIC. So, many 80-column programs lack the visual
enhancements common to C-64 programs.
How about a compromise? What if you could easily display a smaller
graphic anywhere on the screen?
Print Shop Icons are an ideal source for small graphics. Existing
images are plentiful or you can use The Print Shop Companion to draw just
the graphic you want. LOADSTAR's COMPLEAT PRINT SHOP disks contain over
2600 Print Shop icons. You're sure to find an icon in this collection to
fit your needs.
Armed with a good idea for a program and an icon library you're almost
ready to begin, except for two major impediments. Print Shop 3-block icons
are stored in a format totally unlike any Commodore screen or font storage.
And, on the 80-column screen, if icons were displayed at their normal 11
byte width, they would be "squashed" horizontally. So a utility is needed
to alter the format and double the width, and 128 PRINT SHOP TO FONT does
just that.
USING PRINT SHOP TO FONT
------------------------
128 PS TO FONT is a freestanding utility. You can write a program that
uses only the utility and icons. However, it is also compatible with
CONTROL80 and 128 RLE for more complex applications.
First you must decide how you are going to make use of the PS icons. If
your program will use only a few icons, you can store them on disk
individually and BLOAD them as needed.
When numerous icons are required you should bundle them into a single
file. There are several ways to accomplish this, but here is the method I
used for the demo:
1) With no program in memory, enter the built-in MONITOR and fill an area
of memory with a known value, let's say, BB.
F 02000 04000 BB
then exit the monitor.
2) BLOAD all of your icons into successive areas of memory, 3 pages apart
(768 bytes), from direct mode, as follows:
BLOAD"Icon 1",B0,P8192
BLOAD"Icon 2",B0,P8960
etc.
There are two reasons for spacing the icons on page boundaries. First,
a PS icon is 11 characters wide and 6-1/2 characters high. 128 PS TO FONT
uses the 44 bytes beyond each icon as a work area to account for the stray
1/2 character. Second, it is easier to keep track of the indexing for
multiple icons.
You could write a 3-line Q&D program to read the icon names from DATA
statements, increment the load address with a variable, and complete the
above process in one operation. But, unless you plan to make several icon
files, it may not be worth the bother.
3) When all of your icons are in memory, enter the MONITOR again, and
scan memory with the "M" command to find the ending address of the last
icon plus one (+1). Note the address and exit the monitor.
4) BSAVE the icons as a single file using the following syntax, where
"start" is the beginning address of the first icon and "end" is the address
of the end of the last icon:
BSAVE"FILENAME,B0,Pstart TO Pend+1
Or, if you're comfortable with the monitor, you could save the icons as a
single file inside the monitor, using hex numbers and the S (save)
command.
5) If the icon file is relatively short you may wish to end the process
at this point. Otherwise, use 128 RLE (Run Length Encoding) Packer/Unpacker
to "PACK A FILE", thus creating a file which takes up less disk space and
loads more quickly. Then include 128 RLE in your program to unpack the
file.
You are now ready to begin your program. There are six versions of 128
PS TO FONT on disk and their file names indicate the necessary load
address:
128 PS-FONT 0C00
128 PS-FONT 1300
128 PS-FONT 1C00
128 PS-FONT 2400
128 PS-FONT 3500
128 PS-FONT 3800
If you absolutely need a version at a location not found above, you can
use Jeff Jones' ML MOVER from LS 64 #156 to create versions almost anywhere
you want.
Use BLOAD to load 128 PS TO FONT into bank 0, where dv is the number of
the active device:
BLOAD"128 PS-FONT xxxx",B0,U(dv)
The choice of which version to use depends upon what else you have
going on. If 128 PS TO FONT is the only utility you will be using, $0C00 or
$1300 are perhaps the best choices. You will notice the accompanying demo
uses both CONTROL80 and 128-RLE so the $1C00 version is the one to use. The
remaining versions are intended to nestle among the various incarnations of
CONTROL80, custom fonts, etc. If you choose to move the start of BASIC to
$4000, any of the higher versions may be used, with or without other
utilities.
FENDER'S NOTE: When I use CONTROL80, I invariably move the start of BASIC
up to $4000 with the GRAPHIC1,1:GRAPHIC0:GRAPHIC5 sequence. I've never
written a 128 mode BASIC program so large that I needed BASIC to start at
the normal $1300, or even $1C00. So why not move BASIC up to $4000 and use
that open area from the top of CONTROL80 to $4000 for buffers, ML routines,
etc.?
128 PS TO FONT supports two different types of icon displays -- full-
size and cropped. Full-size icons require 154 characters (22 x 7). As a
result, only two different icons may be imbedded in the character sets. One
in the upper portion of font 0 and the other in the upper portion of font
1.
This not only limits the number of possibilities, but the 22 x 7 size
doesn't space well on a 80 x 25 screen. Unless there is a critical need to
display the entire icon, cropping is preferable.
128 PS TO FONT can automatically crop an icon for you. The utility
trims 2 rows of pixels from the top and bottom of the image and 4 pixels
from both the left and right sides. The resulting image is 20 x 6
characters in size. You may wish to take this into consideration when you
select your icons, and use Print Shop Companion to edit them beforehand.
Sixteen cropped icons fit nicely on the screen and you can store three
different icons simultaneously, still leaving 128 character definitions for
text.
Numerous arrangements are possible, depending upon the needs of your
program. Some of the possibilities include:
1) Store one icon in the upper half of font 0 and another in the upper
half of font 1. This leaves both uppercase and lowercase text intact.
2) Reverse the above process, leaving both reversed character sets
available.
3) Store two icons in one font or the other. You then have one entire
character set for text/graphics characters.
4) Store two icons in one or the other font and one in half of the
remaining font. 128 text characters remain available in either normal or
reverse.
It is theoretically possible to store four icons at one time. However,
doing so will corrupt any text characters on the screen and prevent further
use of text until at least one font is restored with CONTROL80's FCOPY.
While it is not necessary to include a custom font, if you plan to
write a program for LOADSTAR it is not likely to be accepted without one.
Include CONTROL80 in your program and FCOPY a custom font